package com.se.exception;

import com.se.enums.ResultCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 接口统一返回结果异常类
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ResultException extends Exception{
	private Integer code;
	private String msg;

	public ResultException(Integer code, String msg){
		super(msg);
		this.code = code;
		this.msg = msg;
	}
	public ResultException(ResultCode resultCode){
		this(resultCode.getCode(), resultCode.getMsg());
	}
}
